<template>
	<view class="page-index">
		<view class="titleBox" :style="{  position: 'sticky', top: 0 + 'px', 'padding-top': menu.top + 'px', background: '#fff' }">
			<!-- <view class="title1">机修修</view> -->
			<view class="title3" :style="{height: menu.bottom - menu.top + 'px',}">订单</view>
			<view class="" style="background: #fff;padding-top: 24rpx;">
				<view class="content">
					<view class="tabs" v-for="(item, index) in tabsList" :key="index" @click="tabsChange(index)" :style="{ color: tabsIndex == index ? '#2C94F5' : '#000' }">
						<text>{{ item.title }}</text>
					</view>
				</view>
				<view class="">
					<view class="tabs-border" :style="{ width: 100 / tabsList.length + 'vw', 'margin-left': tabsIndex * (100 / tabsList.length) + 'vw' }"><view class="borders"></view></view>
				</view>
			</view>
		</view>
		
		<view class="orderBox">
			<view class="orderItem" v-for="(item, index) in list" :key="index" @click="jump(item)">
				<view class="orderInfo">
					<view class="orderTitle">施工门店:</view>
					<view class="orderValue">{{ item.shop_name }}</view>
				</view>
				<view class="orderInfo">
					<view class="orderTitle">施工类型:</view>
					<view class="orderValue">{{ item.con_name }}</view>
				</view>
				<view class="orderInfo">
					<view class="orderTitle">施工车型:</view>
					<view class="orderValue">{{ item.car_model }}</view>
				</view>
				<view class="orderInfo">
					<view class="orderTitle">到店时间:</view>
					<view class="orderValue">{{ workTime(item.work_time) }}</view>
				</view>
				<view class="orderInfo" v-if="Number(item.coupon_price)>0">
					<view class="orderTitle">优惠券:</view>
					<view class="orderValue">¥{{ item.coupon_price }}</view>
				</view>
				<view class="orderInfo" v-if="Number(item.price)>0">
					<view class="orderTitle">总金额:</view>
					<view class="orderValue">¥{{ item.price }}</view>
				</view>
				<view class="buttonBox" v-if="item.status==2&&item.pay_type == 'online'&&item.online_pay_status==0">
					<view class="pay" @click.stop="goPay(item)">
						去支付
					</view>
				</view>
			</view>
		</view>
		<view class="empty" v-if="loading&&list == ''">
			<image src="/static/home/empty.png" class="emptyImage"></image>
			<view style="margin-top: 24rpx;">
				暂无数据
			</view>
		</view>
		<view class="empty" v-if="!token">
			<button class="loginBox" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
				请登录
			</button>
		</view>
	</view>
</template>

<script src="./page.js"></script>
<style>
page {
	background: #f5f5f5;
}
</style>
<style scoped lang="scss">
@import 'page.scss';
</style>
